package com.common.retrofit.methods;

import com.common.retrofit.base.BaseMethods;
import com.common.retrofit.service.HaiNingService;

import java.util.List;

import rx.Observable;
import rx.Subscriber;

public class PublishRentHouseMethods extends BaseMethods {

    private static PublishRentHouseMethods m_ins = null;

    public static PublishRentHouseMethods getInstance() {
        if (m_ins == null) {
            synchronized (PublishRentHouseMethods.class) {
                if (m_ins == null) {
                    m_ins = new PublishRentHouseMethods();
                }
            }
        }
        return m_ins;
    }

    @Override
    protected String getHttpUrl() {
        return "House/";
    }

    private HaiNingService initService() {
        return getRetrofit().create(HaiNingService.class);
    }


    public void fabu_rental(Subscriber<List> subscriber,
                      String uid ,
                      String loupan_name,String province_str ,String city_str ,String area_str  ,String loupan_address  ,String acreage  ,String price   ,String fabu_mobile
            ,String room_num ,String office_num  ,String toilet_num ,String checkcode

    ) {
        Observable observable = initService().fabu_rental(System.currentTimeMillis()+"",
                "5f97b31dc057b772724f24df46fcd2a8", uid ,
                 loupan_name, province_str , city_str , area_str  , loupan_address  , acreage  , price   , fabu_mobile
                , room_num , office_num  , toilet_num ,checkcode
        );
        toSubscribe(observable, subscriber);
    }
}
